package flatmap

fun main(vararg args: String) {
    /* val listData = listOf(1, 2, 3, -1, 0, -3)
     println("原：${listData.toString()}")
     println("--------------------")
     val filterData = listData.filter { it > 0 }
     println("filter后：${filterData}")*/

    val items = listOf(
        listOf("red apple", "green apple", "bule apple"),
        listOf("red fish", "blue fish"),
        listOf("yellow banana", "teal banana")
    )
    val redItems = items.flatMap {
        it.filter { it.contains("red") }
    }
    println(redItems)
}

